<% @page_title="Your Pragmatic Cart" %>
<h1>Display Cart</h1>
<table>
  <tr style="background-color:lightgray">
    <td>
      Qty
    </td>
    <td>
      Description
    </td>
    <td colspan="2">
      <table>
	<tr colspan="2">Price</tr>
        <tr>
          <td>Each</td>
          <td>Total</td>
        </tr>
      </table>
    </td>
  </tr>
<% for item in @items 
   product = item.product %>
  <tr>
    <td><%=item.quantity%></td>
    <td><%=h product.description%></td>
    <td><%=fmt_dollars item.unit_price%></td>
    <td><%=fmt_dollars item.unit_price*item.quantity%></td>
  </tr>
<% end %>
  <tr>
    <td colspan="3" align="right"><strong>Total:</strong></td>
    <td><%= @cart.total_price %></td>
  </tr>
</table>
<%= link_to "Continue Shopping", :action => "index" %><br/>
<% unless params[:context] == :checkout %>
  <%= link_to "Empty cart", :action => "empty_cart" %><br/>
  <%= link_to "Checkout", :action => "checkout" %><br/>
<% end %>
